package com.gite.nouette.admin.implementation.integrator.builder.module;

import com.gite.nouette.admin.contract.integrator.builder.module.IBuilderModuleError;
import com.gite.nouette.admin.contract.integrator.factory.IFactoryModel;
import com.gite.nouette.admin.contract.model.IManager;
import com.gite.nouette.admin.contract.model.command.ICommandCreateModule;
import com.gite.nouette.admin.contract.model.module.IModuleError;
import com.gite.nouette.admin.implementation.integrator.builder.AbstractBuilderModule;

public class BuilderModuleErrorImpl extends AbstractBuilderModule implements
		IBuilderModuleError {

	private IModuleError product;

	public BuilderModuleErrorImpl(IFactoryModel factoryModel, IManager manager,
			ICommandCreateModule commandCreateModule) {
		super(factoryModel, manager, commandCreateModule);
	}

	@Override
	public void buildName() {
		getProduct().setName("Gestionnaire d'erreurs");
	}

	@Override
	public void createNewProduct() {
		setProduct(getFactoryModel().getModuleError(getHeaderCommandModules()));
	}

	@Override
	public IModuleError getProduct() {
		return this.product;
	}

	public void setProduct(IModuleError product) {
		this.product = product;
	}
}
